package com.intct.hbase.dml;

import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.IOException;

/**
 * @author gufg
 * @since 2025-07-11 10:48
 */
public class PutDataImpl extends AbsDMLBase {
    @Override
    public void execCommand(Table table) throws IOException {
        // 插入数据
        Put put = new Put(Bytes.toBytes("1010"));
        put.addColumn(Bytes.toBytes("f1"), Bytes.toBytes("name"), Bytes.toBytes("wangwu"));
        put.addColumn(Bytes.toBytes("f1"), Bytes.toBytes("age"), Bytes.toBytes("20"));
        put.addColumn(Bytes.toBytes("f1"), Bytes.toBytes("sex"), Bytes.toBytes("4"));

        table.put(put);
    }

    public static void main(String[] args) throws IOException {
        new PutDataImpl().start("intct82", "t001");
    }
}
